package com.walle.bio;

import java.util.concurrent.*;

/**
 * @author zhangjiapeng
 * @Package com.walle.bio
 * @Description: ${todo}
 * @date 2019/1/21 10:13
 */
public class TimeServerHandlerExcutePool {


    private ThreadPoolExecutor threadPoolExecutor;

    public TimeServerHandlerExcutePool(int corePoolSize,int maxPoolSize,int queueSize){
        BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue(queueSize);
        threadPoolExecutor = new ThreadPoolExecutor(corePoolSize,maxPoolSize,100L,TimeUnit.SECONDS,blockingQueue);
    }

    public void excute(Runnable task){
        threadPoolExecutor.execute(task);
    }
}
